package org.example.IO;

import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.InputStream;

/**
 * @className: Demo9
 * @author: 芃
 * @description: 文件的读取（字节流）
 * @date: 2024/5/6 16:24
 */
public class Demo9 {
    public static void main(String[] args) {
        try(InputStream inputStream = new FileInputStream("D:\\My_Code\\Java_Code\\EE_And_System_New\\Test\\src\\main\\java\\org\\example\\IO\\test2.txt")){
            byte[] bytes = new byte[1024];
            int len = inputStream.read(bytes);
            for (int i = 0; i < len; i++) {
                System.out.printf("%c\n", bytes[i]);
            }
        } catch (FileNotFoundException e) {
            throw new RuntimeException(e);
        } catch (IOException e) {
            throw new RuntimeException(e);
        }
    }
}
